package com.ylr.send.framework.feign.client;

import com.ylr.send.common.dto.SendSmsDto;
import com.ylr.base.common.tool.Result;
import com.ylr.send.common.vo.BatchSendSmsVo;
import com.ylr.send.common.vo.SendSmsVo;
import com.ylr.send.framework.feign.SmsBaseClient;
import com.ylr.send.framework.feign.fallback.YsSmsClientFallback;
import com.ylr.send.framework.feign.configuration.ClientConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-09-05 10:54:22
 * className: YsSmsClient
 * version: 1.0
 * description:
 */
@FeignClient(value = "ylr-send", contextId = "YsSmsClient", path = "/api/sms",
        fallback = YsSmsClientFallback.class, configuration = ClientConfiguration.class)
public interface YsSmsClient extends SmsBaseClient {

    /**
     * 发送短信接口
     * @param sendSmsVo 参数对象
     * @return 发送结果
     */
    @PostMapping("/send")
    Result<SendSmsDto> sendSms(@Validated @RequestBody SendSmsVo sendSmsVo);

    /**
     * 批量发送短信接口
     * @param batchSendSmsVo 参数对象
     * @return 发送结果
     */
    @PostMapping("/batch/send")
    Result<SendSmsDto> batchSendSms(@RequestBody BatchSendSmsVo batchSendSmsVo);

}
